<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>

<head>
<meta name="decorator" content="moduleEdit" />
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<script type="text/javascript" src="${staticPath}/js/jquery-dialog.js"></script>
<script type="text/javascript" src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js"></script>
<script type="text/javascript" src="${staticPath}/js/jQuery.FillOptions.js"></script>
<script type="text/javascript" src="${staticPath}/js/negotiation.js"></script>
<script type="text/javascript" src="${staticPath}/js/negLoad.js"></script>
<script type="text/javascript" src="${staticPath}/js/selectBerth.js"></script>
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
<script src="${staticPath}/lib/chosen/1.1.0/chosen.jquery.js" type="text/javascript"></script>
<script src="${staticPath}/js/ossp-jquery-chosen.js" type="text/javascript"></script>

<script type="text/javascript">
var max_tr_contact = '${fn:length(assrecords.negAssTempItemCodeList)}';
var contextpath='${contextPath}';

var negAssbaseitemsNum = '${fn:length(assrecords.negAssbaseitems)}';
var negAssitemsNum = '${fn:length(assrecords.negAssitems)}';
var num = '${fn:length(assrecords.negAssbrands )}';

var	assbaseitemList = Array();
var	assitemsList = Array();
var	assBrandList = Array();

var contextpath='${contextPath}';
var	assBrandList = Array();
for (var i = 0; i < num; i++) {
	assBrandList.push(i);
}

</script>
<style type="text/css">
#modalAssbaseitems .modal-dialog {
	width: 60%;
}
#modalAssitems .modal-dialog {
	width: 60%;
}
#modalBrand .modal-dialog {
	width: 60%;
}
#supplierModal .modal-dialog {
	width: 70%;
}
</style>
</head>
<body>

	<div class="Report_f">
		<div class="Report_f_1">
			<form:form id="assrecordsForm"
				action="" method="post" class="form-horizontal" role="form">
				
				<div class="Report_f_title_1">促销
				<c:if test="${assinfo.isModifyContract =='1'}">变更</c:if>
				<c:if test="${assinfo.isModifyContract !='1'}">
					<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${negType}"></ossp:value>
				</c:if>
				洽谈</div>
				
				<input type="hidden" value="${contractType }" name="assinfo.contractType" id="contractType"/>
				<input type="hidden" value="${negType }" name="assinfo.negotiationType" id="negType"/>
				<input type="hidden" value="${assinfo.isModifyContract }" name="assinfo.isModifyContract"  id="isModifyContract"> 
				<input type="hidden" value="${assinfo.id }" name="assinfo.id"> 
				<input type="hidden" value="${assinfo.shopId }" name="assinfo.shopId" id="brand_No"> 
				<input type="hidden" value="${navId}" name="navId" id="navId"> 
				<input type="hidden" value="${assrecords.assinfo.number}" name="assinfo.number" id="number"> 
				<input type="hidden" value="${assinfo.contractId}" name="assinfo.contractId" id="contractId">
				<input type="hidden" value="${assinfo.contractNo}" name="assinfo.contractNo" id="contractNo"> 
				<input type="hidden" value="${positionLog }" id="positionLog" />
				
				<c:if test="${assinfo.status == 1 || assinfo.status==null }">
					<input type="hidden" value="2" name="assinfo.status">
				</c:if>
				
				<c:if test="${negType == '40'}">
					<input type="hidden" value="view" id="flag" />
				</c:if>
				
				<div>
					<div class="tab-content Report_f_title_3 ">
						<div class="tab-pane active" id="home">
							<div class="Report_f_title_4">
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4" >管理区域:</label>
										<div class="col-sm-6 f_6">
											<div class="input-group">
												<input type="text" class="f_5" value="${assinfo.area }" id="area" name="assinfo.area" readonly="readonly"  /> 
												<input type="hidden" id="areaId" name="assinfo.areaId" value="${assinfo.areaId }"  />
												<span class="input-group-btn">
													<button class="btn btn-default btn_3" id="areaDialog" type="button" disabled="disabled">选择</button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">签约门店:</label>
											<div class="col-sm-6 f_6">
												<select class="f_5" id="storeId" name="storeId" disabled="disabled">
													<option value="">---请选择---</option>
												</select>
												<input type="hidden" id="store" value="${assinfo.store }" name="assinfo.store" />
												<input type="hidden" id="storeId_hid" value="${assinfo.storeId }" name="assinfo.storeId" />
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">签约楼层:</label>
											<div class="col-sm-6 f_6">
												<select class="f_5" id="floorId" name="floorId" onchange="cleanShop()">
													<option value="">---请选择---</option>
												</select>
												<input type="hidden" id="floor" value="${assinfo.floor }" name="assinfo.floor" />
												<input type="hidden" id="floor_hid" value="${assinfo.floorId }" name="assinfo.floorId" />
											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">签约商铺:</label>
										<div class="col-sm-6 f_6">
											<div class="input-group">
												<input type="hidden" id="shop" name="negAssshopsList[0].shop" value="<c:forEach items="${assrecords.negAssshopsList }" var="assshopEntity" varStatus="i">${assshopEntity.shop }<c:if test="${fn:length(assrecords.negAssshopsList) != i.count}">,</c:if></c:forEach>"/> 
												<input type="text" class="f_5" id="shopIds" name="negAssshopsList[0].shopId" value="<c:forEach items="${assrecords.negAssshopsList }" var="assshopEntity" varStatus="i">${assshopEntity.shopId }<c:if test="${fn:length(assrecords.negAssshopsList) != i.count}">,</c:if></c:forEach>" readonly="readonly"/> 
												<span class="input-group-btn">
													<button class="btn btn-default btn_3" id="shopDialog" type="button" <c:if test="${assinfo.isModifyContract!='1' && ( negType=='20' || negType=='40')}">disabled='disabled'</c:if> >选择</button>
												</span>
											</div>
										</div>
									</div>
								</div>
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">业态:</label>
										<div class="col-sm-6 f_6">
											<select id="formatIdSelect" class="f_5"
												onchange="changeSelect('#formatId',this.options[this.options.selectedIndex].value)" disabled="disabled">
											</select>
											<input type="hidden" name="formatId" id="formatId"  value="${assrecords.formatId}" />
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">签约主体:</label>
											<div class="col-sm-6 f_6">
												<input type="text" class="f_5 required" id="signBodyName" value="${assinfo.signBody}" readonly="readonly" />
												<input type="hidden" id="signBody" name="assinfo.signBody" value="${assinfo.signBody}"  />
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">建筑面积:</label>
										<div class="col-sm-6 f_6"> 
												<input type="text" class="f_5 required" id="contractArea" name="buildArea" value="${assrecords.buildArea}" />
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">面积分摊系数:</label>
											<div class="col-sm-6 f_6">
												<input type="text" class="f_5 required"
															id="areaCoefficient" name="areaCoefficient"
															value="${assrecords.areaCoefficient}" />
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">收银方式:</label>
										<div class="col-sm-6 f_6">
												<ossp:radio dictType="CONTRACT_CHCKOUTYPE"
																defaultChecked="${assrecords.checkoutType}" 
																id="checkoutType" name="checkoutType"></ossp:radio>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">结算周期:</label>
											<div class="col-sm-6 f_6">
												<ossp:select dictType="BALANCE_CYCLE" id="settlementCycle" class_="f_5 required"
															defaultSelected="${assrecords.settlementCycle}" name="settlementCycle"></ossp:select>
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">坪效:</label>
										<div class="col-sm-6 f_6">
												<input type="text" class="f_5 required" id="benefit" name="benefit" value="${assrecords.benefit}" />
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">付款方式:</label>
										<div class="col-sm-6 f_6">
											<ossp:select dictType="PAYMENT_METHOD" id="paymentType"
												name="paymentType" defaultSelected="${assrecords.paymentType }" class_="f_5 required"></ossp:select>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">自派导购:</label>
										<div class="col-sm-6 f_6">
												<ossp:select dictType="GUIDE_TYPE" id="guideType" defaultSelected="0" value="${assrecords.guideType}" name="guideType_Display" class_="f_5 required"></ossp:select>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">导购数量:</label>
											<div class="col-sm-6 f_6">
												<input type="text" class="f_5 required" id="guideAmount" name="guideAmount_Display" value="${assrecords.guideAmount}" />
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6" style="display: none;">
										<label for="inputtext3" class="col-sm-3 control-label f_4">供应商经营方式:</label>
										<div class="col-sm-6 f_6">
												<ossp:select dictType="BUSINESS_TYPE_" id="businessType" name="businessType"
																defaultSelected="${assrecords.businessType}" class_="f_5 required"></ossp:select>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<div>
											<label for="inputtext3" class="col-sm-3 control-label f_4">目标销售额:</label>
											<div class="col-sm-6 f_6">
												<input type="text" class="f_5 required"
														id="salesAmount" name="salesAmount" value="${assrecords.salesAmount}" />
											</div>
										</div>
									</div>
								</div>
								
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-8">
										<label for="inputtext3" class="col-sm-2	 control-label f_4">供应商:</label>
										<input id="supplierId" type="hidden" value="${assinfo.supplierId }" name="assinfo.supplierId">
										<input id="supplierNo" type="hidden" value="${assinfo.supplierNo }" name="assinfo.supplierNo">
										<div class="input-group ">
											<input id="supplierName" name="assinfo.supplierName"
												value="${assinfo.supplierName }" maxlength="200"
												class="f_5" readonly="readonly" /> <span
												class="input-group-btn">
												<button class="btn btn-default btn_3" id="supplier"
													type="button" disabled="disabled">选择</button>
											</span>
										</div>

									</div>
								</div>
								
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">税票类型:</label>
										<div class="col-sm-6 f_6" id="taxTypeDiv">
											<ossp:select dictType="INVOICE_TYPE" defaultSelected="${assinfo.taxType }" onchange="taxTypeChange(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" id="taxTypeCode_select" name="taxTypeCode_select" class_="f_5 "></ossp:select>
											<input type="hidden" id="taxType" name="taxType"/>
											<input type="hidden" id="taxTypeCode" value="${assinfo.taxType }" name="assinfo.taxType"/>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">税率:</label>
										<div class="col-sm-6 f_6">
											<select class="f_5" id="taxRateCode_select"
												onchange="taxRateCodeChange(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)"
												name="taxRateCode_select">
											</select>
											<input type="hidden" id="taxRate" name="taxRate"/>
											<input type="hidden" id="taxRateCode" value="${assinfo.taxRate }" name="assinfo.taxRate"/>
										</div>
									</div>
								</div>
								
								<!-- ================================================= -->
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同起始日期:</label>
										<div class="col-sm-7">
											<div class="input-group date startDate " data-date=""
												data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly id="startDate" name="startDate"
													value="<fmt:formatDate value="${assrecords.startDate}" type="both" pattern="yyyy-MM-dd"/>" size="10" type="text" /> 
												<span class="input-group-addon"><span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>

											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同终止日期:</label>
										<div class="col-sm-7">
											<div class="input-group date endDate " data-date=""
												data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly id="endDate" name="endDate"
													value="<fmt:formatDate value="${assrecords.endDate}" type="both" pattern="yyyy-MM-dd"/>" size="10" type="text" /> 
												<span class="input-group-addon"><span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>

											</div>
										</div>
									</div>
								</div>
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">文本开始日期:</label>
										<div class="col-sm-7">
											<div class="input-group date startDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly="readonly" id="textStartDate" type="text" name="textStartDate" value="<fmt:formatDate value="${assrecords.textStartDate}"  pattern="yyyy-MM-dd"/>" size="10"  /> 
												<span class="input-group-addon">
												<span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>

											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3	 control-label f_4">文本结束日期:</label>
										<div class="col-sm-7">
											<div class="input-group date startDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly="readonly" id="textEndDate" type="text" name="textEndDate" value="<fmt:formatDate value="${assrecords.textEndDate}"  pattern="yyyy-MM-dd"/>" size="10"  /> 
												<span class="input-group-addon">
												<span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>
											</div>
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<c:if test="${assinfo.isModifyContract == '1' }">
										<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-3 control-label f_4">合同生效日期:</label>
											<div class="col-sm-7">
												<div class="input-group date effectDate "  data-date-format="yyyy-mm-dd">
													<input class="f_5" readonly="readonly" type="text" id="effectDate" name="effectDate" value="<fmt:formatDate value="${assrecords.effectDate}"  pattern="yyyy-MM-dd"/>" />
													<span class="input-group-addon"><span
														class="glyphicon glyphicon-remove"></span></span> <span
														class="input-group-addon"><span
														class="glyphicon glyphicon-calendar"></span></span>
												</div>
												<span id="endDateMessage" class=" help-inline" style="color: red;"></span>
											</div>
										</div>
									</c:if>		
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">主合同号:</label>
										<div class="col-sm-6 f_6">
											<input type="text" class="f_5 required" id="mainContractId" name="assinfo.mainContractId" value="${assinfo.mainContractId}" />
										</div>
									</div>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<table class="table " id="table1">
										<thead>
											<tr>
												<th class="col-sm-4">费用项目</th>
												<th>费用内容</th>
											</tr>
										</thead>
										<tbody>
											<tr>
												<td>供应商用电</td>
												<td><div class="col-sm-4">
														<ossp:radio id="otherItems"
															name="isUndertakeElec"
															defaultChecked="${assrecords.isUndertakeElec}"
															dictType="SUPPLIER_POWER"
															onchange="changeSelect('#isUndertakeElec',this.value)"></ossp:radio>
													</div></td>
											</tr>
											<tr>
												<td>员工制服</td>
												<td><div class="col-sm-3">
														<ossp:radio dictType="WORK_CLOTHES" defaultChecked="${assrecords.workClothes}" name="workClothes"></ossp:radio>
													</div></td>
											</tr>
											<tr>
												<td>培训费</td>
												<td><div class="col-sm-10">
														<ossp:radio dictType="COMMN_DICT" defaultChecked="${assrecords.isTraining}" name="isTraining" onclick="is_bear('isTraining')"></ossp:radio>
														&nbsp;&nbsp;&nbsp;<label id="isTraining_div" <c:if test="${assrecords.isTraining != 1 }">style="display: none;"</c:if> >金额：<input type="text" value="${assrecords.isTrainingAmount }" name="isTrainingAmount" id="isTrainingAmount"/></label>
													</div></td>
											</tr>
											<tr>
												<td>工卡费</td>
												<td><div class="col-sm-10">
														<ossp:radio dictType="COMMN_DICT" defaultChecked="${assrecords.isJobCard}" name="isJobCard" onclick="is_bear('isJobCard')"></ossp:radio>
														&nbsp;&nbsp;&nbsp;<label id="isJobCard_div" <c:if test="${assrecords.isJobCard != 1 }">style="display: none;"</c:if> >金额：<input type="text" value="${assrecords.isJobCardAmount }" name="isJobCardAmount" id="isJobCardAmount"/></label>
													</div></td>
											</tr>
											<tr>
												<td>品牌形象维护费</td>
												<td><div class="col-sm-3">
														<ossp:radio dictType="COMMN_DICT" defaultChecked="${assrecords.isBrandImage}" name="isBrandImage"></ossp:radio>
												</div></td>
											</tr>
										</tbody>
									</table>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<h4>
										合同品牌信息 <input
											onclick="showModalBrand()"
											type="button" name="addBtn" class="btn btn-success btn-sm pull-right"
											value="添加"></input>
									</h4>
									
									<table class="table table-bordered" id="negAssBrands">
											<tr class="text-center">
												<td class="text-center" style="width: 16%">品牌中文名称</td>
												<td class="text-center" style="width: 16%">品牌英文名称</td>
												<td class="text-center" style="width: 16%">招商分类</td>
												<td class="text-center" style="width: 16%">品牌责任人</td>
												<td class="text-center" style="width: 16%">商铺</td>
												<td class="text-center" style="width: 16%">操作</td>
												<td class="text-center" style="display: none;">hiddeValue</td>
											</tr>
											<tbody id="assBrandTbody">
											<c:forEach items="${assrecords.negAssbrands }" var="negAssbrands" varStatus="i">
												<tr>
													<td class="text-center" ><label id='brandCname_label${i.index }'>${negAssbrands.brandCname }</label></td>
													<td class="text-center" ><label id='inviteCate_label${i.index }'>${negAssbrands.brandename }</label></td>
													<td class="text-center" ><label id='mainBrands_label${i.index }'>${negAssbrands.inviteCateName }</label></td>
													<td class="text-center" ><label id='brandInviteHead_label${i.index }'>${negAssbrands.brandInviteHead }</label></td>
													<td class="text-center" ><label id='shop_label${i.index }'>
														<c:forEach items="${negAssbrands.negAsshsb }" var="negAsshsb" varStatus="j">
															${negAsshsb.negAssshop.shopId}	
															<c:if test="${fn:length(negAssbrands.negAsshsb) != j.count }">,</c:if>
														</c:forEach>	
													</label></td>
													<td class="text-center"><a href="javascript:void(0)" onclick="showModalBrand(this, this.parentElement.parentElement.rowIndex, ${i.index })"><c:if test="${negType == 40 }">查看</c:if><c:if test="${negType != 40 }">修改</c:if></a>&nbsp;&nbsp;<a href='javascript:void(0)' class='delete' onclick='removeAssBrandRow(this, this.parentElement.parentElement.rowIndex)'>删除</a></td>
													<td class="text-center" style="display: none;">
														<input type='hidden' id='brandId${i.index }' name='negAssbrands[${i.index }].brandId' value='${negAssbrands.brandId }' />
														<input type='hidden' id='inviteCate${i.index }' name='negAssbrands[${i.index }].inviteCate' value='${negAssbrands.inviteCate }' />
													    <input type='hidden' id='memberRateType${i.index }' name='negAssbrands[${i.index }].memberRateType' value='${negAssbrands.memberRateType }' />
													    <input type='hidden' id='gcardDiscount${i.index }' name='negAssbrands[${i.index }].gcardDiscount' value='${negAssbrands.gcardDiscount }' />
													    <input type='hidden' id='gcardDiscount2${i.index }' name='negAssbrands[${i.index }].gcardDiscount2' value='${negAssbrands.gcardDiscount2 }' />
													    <input type='hidden' id='ocardDiscount${i.index }' name='negAssbrands[${i.index }].ocardDiscount' value='${negAssbrands.ocardDiscount }' />
													    <input type='hidden' id='ocardDiscount2${i.index }' name='negAssbrands[${i.index }].ocardDiscount2' value='${negAssbrands.ocardDiscount2 }' />
													    <input type='hidden' id='mainBarnd${i.index }' name='negAssbrands[${i.index }].mainBrands' value='${negAssbrands.mainBrands }' />
<%-- 													    <input type='hidden' id='brandNo${i.index }' name='negAssbrands[${i.index }].brandNo' value='${negAssbrands.mainBrands }' /> --%>
													    <input type='hidden' id='brandCname${i.index }' name='negAssbrands[${i.index }].brandCname' value='${negAssbrands.brandCname }' />
													    <input type='hidden' id='brandename${i.index }' name='negAssbrands[${i.index }].brandename' value='${negAssbrands.brandename }' />
													    <input type='hidden' id='brandAttribute${i.index }' name='negAssbrands[${i.index }].brandAttribute' value='${negAssbrands.brandAttribute }' />
													    <input type='hidden' id='brandLevel${i.index }' name='negAssbrands[${i.index }].brandLevel' value='${negAssbrands.brandLevel }' />
													    <input type='hidden' id='commodityCate${i.index }' name='negAssbrands[${i.index }].commodityCate' value='${negAssbrands.commodityCate }' />
													    <input type='hidden' id='shopNames${i.index }' name='negAssbrands[${i.index }].shopNames' value='<c:forEach items="${negAssbrands.negAsshsb }" var="negAsshsb" varStatus="j">${negAsshsb.negAssshop.shop }<c:if test="${fn:length(negAssbrands.negAsshsb) != j.count }">,</c:if></c:forEach>' />
													    <input type='hidden' id='assShopIds${i.index }' name='negAssbrands[${i.index }].shopIds' value='<c:forEach items="${negAssbrands.negAsshsb }" var="negAsshsb" varStatus="j">${negAsshsb.negAssshop.shopId }<c:if test="${fn:length(negAssbrands.negAsshsb) != j.count }">,</c:if></c:forEach>' />
													    <input type='hidden' id='brandInviteHead${i.index }' name='negAssbrands[${i.index }].brandInviteHead' value='${negAssbrands.brandInviteHead }' />
													    <input type='hidden' id='iszs${i.index }' name='negAssbrands[${i.index }].iszs' value='${negAssbrands.iszs }' />
													</td>
												</tr>
											</c:forEach>
									</table>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<h4>
										销售分成及结算条款 <input
											onclick="showModalBaseitems()"
											type="button" name="addBtn" class="btn btn-success btn-sm pull-right"
											value="添加"></input>
									</h4>
									
									<table class="table table-bordered" id="negAssbaseitems">
											<tr class="text-center">
												<td class="text-center" style="width: 11%">是否保底</td>
												<td class="text-center" style="width: 11%">保底金额</td>
												<td class="text-center" style="width: 11%">扣款下限</td>
												<td class="text-center" style="width: 11%">扣款上限</td>
												<td class="text-center" style="width: 11%">扣率</td>
												<td class="text-center" style="width: 11%">开始日期</td>
												<td class="text-center" style="width: 11%">结束日期</td>
												<td class="text-center" style="width: 7%">状态</td>
												<td class="text-center" style="width: 13%">操作</td>
												<td class="text-center" style="display: none;">hiddeValue</td>
											</tr>
											<tbody id="tbody">
											<c:forEach items="${assrecords.negAssbaseitems }" var="negAssbaseitems" varStatus="i">
												<tr>
													<td class="text-center" ><label id='isGuarantee_lab${i.index }'><ossp:value dictType="DEFEND_BASE" key="${negAssbaseitems.isGuarantee }"></ossp:value></label></td>
													<td class="text-center" ><label id='guaranteeAmount_lab${i.index }'>${negAssbaseitems.guaranteeAmount }</label></td>
													<td class="text-center" ><label id='lower_lab${i.index }'>${negAssbaseitems.lower }</label></td>
													<td class="text-center" ><label id='upper_lab${i.index }'>${negAssbaseitems.upper }</label></td>
													<td class="text-center" ><label id='deductRate_lab${i.index }'>${negAssbaseitems.deductRate }</label></td>
													<td class="text-center" ><label id='startDate_lab${i.index }'><fmt:formatDate value="${negAssbaseitems.startDate }" pattern="yyyy-MM-dd"/></label></td>
													<td class="text-center" ><label id='endDate_lab${i.index }'><fmt:formatDate value="${negAssbaseitems.endDate }" pattern="yyyy-MM-dd"/></label></td>
													<td class="text-center" ><label id='status_lab${i.index }'><ossp:value dictType="NEG_BASEITEMS_STATUS" key="${negAssbaseitems.status }"></ossp:value></label></td>
													<td class="text-center">
													<c:if test="${assinfo.isModifyContract == '1'}">		<!-- 变更 -->
														<c:if test="${negAssbaseitems.isOriginal == '1'}">			<!-- 原合同的条款 -->
															<a href="javascript:void(0)" onclick="showModalBaseitems(this, this.parentElement.parentElement.rowIndex, ${i.index }, 'view')">查看</a>&nbsp;&nbsp;
<!-- 															<a href='javascript:void(0)' class='delete' style='color: #e8e8e8'>删除</a>&nbsp;&nbsp; -->
															<a href='javascript:void(0)' class='delete' onclick="status_zf(${i.index })" id="cancel">作废</a>&nbsp;&nbsp;
															<a href='javascript:void(0)' class='delete' onclick='addRow(${i.index })'>复制</a>
														</c:if>
														<c:if test="${negAssbaseitems.isOriginal != '1'}">			<!-- 新增加的条款 -->
															<a href="javascript:void(0)" onclick="showModalBaseitems(this, this.parentElement.parentElement.rowIndex, ${i.index })">修改</a>&nbsp;&nbsp;
															<a href='javascript:void(0)' class='delete' onclick='removeFile(this, this.parentElement.parentElement.rowIndex)'>删除</a>&nbsp;&nbsp;
															<a href='javascript:void(0)' class='delete' onclick='' style='color: #e8e8e8'>复制</a>
														</c:if>
													</c:if>
													<c:if test="${assinfo.isModifyContract != '1'}">		<!--非变更 -->
														<a href="javascript:void(0)" onclick="showModalBaseitems(this, this.parentElement.parentElement.rowIndex, ${i.index })"><c:if test="${negType == 40 }">查看</c:if><c:if test="${negType != 40 }">修改</c:if></a>&nbsp;&nbsp;
														<a href='javascript:void(0)' class='delete' onclick='removeFile(this, this.parentElement.parentElement.rowIndex)'>删除</a>&nbsp;&nbsp;
													</c:if>
													
													</td>
													<td class="text-center" style="display: none;">
														<input type="hidden" id='isGuarantee${i.index }' name="negAssbaseitems[${i.index }].isGuarantee" value="${negAssbaseitems.isGuarantee }"></input> 
													    <input type="hidden" id='lower${i.index }' name="negAssbaseitems[${i.index}].lower" value="${negAssbaseitems.lower }"></input>
													    <input type="hidden" id='upper${i.index }' name="negAssbaseitems[${i.index }].upper" value="${negAssbaseitems.upper }"></input>
													    <input type="hidden" id='payDate${i.index }' name="negAssbaseitems[${i.index }].payDate" value="${negAssbaseitems.payDate }"></input>
													    <input type="hidden" id='deductRate${i.index }' name="negAssbaseitems[${i.index }].deductRate" value="${negAssbaseitems.deductRate }"></input>
													    <input type="hidden" id='brandsId${i.index }' name="negAssbaseitems[${i.index }].brandsId" value="${negAssbaseitems.brandsId }"></input>
													    <input type="hidden" id='validType${i.index }' name="negAssbaseitems[${i.index }].validType" value="${negAssbaseitems.validType }"></input>
													    <input type="hidden" id='countbase_base${i.index }' name="negAssbaseitems[${i.index }].countBase" value="${negAssbaseitems.countBase }"></input>
													    <input type='hidden' id='guaranteeType${i.index }' name='negAssbaseitems[${i.index }].guaranteeType' value='${negAssbaseitems.guaranteeType }'/>
													    <input type='hidden' id='deductType_base${i.index }' name='negAssbaseitems[${i.index }].deductType' value='${negAssbaseitems.deductType }'/>
													    <input type='hidden' id='startDate_base${i.index }' name='negAssbaseitems[${i.index }].startDate' value='<fmt:formatDate value="${negAssbaseitems.startDate }" type="both" pattern="yyyy-MM-dd" />'/>
													    <input type='hidden' id='endDate_base${i.index }' name='negAssbaseitems[${i.index }].endDate' value='<fmt:formatDate value="${negAssbaseitems.endDate }" type="both" pattern="yyyy-MM-dd" />'/>
													    <input type='hidden' id='iscommGuarantee${i.index }' name='negAssbaseitems[${i.index }].iscommGuarantee' value='${negAssbaseitems.iscommGuarantee}'/>
													    <input type='hidden' id='guaranteeAmount${i.index }' name='negAssbaseitems[${i.index }].guaranteeAmount' value='${negAssbaseitems.guaranteeAmount }'/>
													    <input type="hidden" id='remarks${i.index }' name="negAssbaseitems[${i.index }].remarks" value="${negAssbaseitems.remarks }"></input>
													    <input type='hidden' id='codeType${i.index }' name='negAssbaseitems[${i.index }].codeType' value='${negAssbaseitems.codeType }'/>
													    <input type='hidden' id='isCompare${i.index }' name='negAssbaseitems[${i.index }].isCompare' value='${negAssbaseitems.isCompare }'/>
													    <input type='hidden' id='id${i.index }' name='negAssbaseitems[${i.index }].id' value='${negAssbaseitems.id }'/>
													    <input type='hidden' id='status${i.index }' name='negAssbaseitems[${i.index }].status' value='${negAssbaseitems.status }'/>
													    <input type="hidden" id="assistId" name="negAssbaseitems[${i.index }].assistId" value="${negAssbaseitems.assistId }">    
													    <input type="hidden" id="isOriginal" name="negAssbaseitems[${i.index }].isOriginal" value="${negAssbaseitems.isOriginal }">    
													</td>
												</tr>
											</c:forEach>
									</table>
								</div>
								<!-- ================================================= -->
								<div class="f_2">
									<h4>
										合同条款 <input
											onclick="showModalAssitems()"
											type="button" name="addBtn" class="btn btn-success btn-sm pull-right"
											value="添加"></input>
									</h4>
									<table class="table table-bordered" id="negAssitems">
											<tr class="text-center">
												<td class="text-center" style="width: 10%">扣款项代码</td>
												<td class="text-center" style="width: 10%">扣款项</td>
												<td class="text-center" style="width: 10%">金额/比例</td>
												<td class="text-center" style="width: 10%">开始日期</td>
												<td class="text-center" style="width: 10%">结束日期</td>
												<td class="text-center" style="width: 10%">扣款时效类型</td>
												<td class="text-center" style="width: 10%">计算基数</td>
												<td class="text-center" style="width: 10%">税率</td>
												<td class="text-center" style="width: 10%">操作</td>
												<td class="text-center" style="display: none;">hiddeValue</td>
											</tr>
											<tbody id="assitemsTbody">
											<c:forEach items="${assrecords.negAssitems }" var="assitems" varStatus="j">
												<tr>
													<td class="text-center"><label id='deductCode_lab${j.index }'>${assitems.deductCode }</label></td>
													<td class="text-center"><label id='deductItem_lab${j.index }'>${assitems.deductItem }</label></td>
													<td class="text-center"><label id="amount_lab${j.index }"><fmt:formatNumber value="${assitems.amount }" pattern="#0.00#"/><c:if test="${fn:startsWith(assitems.deductCode, 'A')}">%</c:if></label></td>
													<td class="text-center"><label id='startDate_lab${j.index }'><fmt:formatDate value="${assitems.startDate }" pattern="yyyy-MM-dd"/></label></td>
													<td class="text-center"><label id='endDate_lab${j.index }'><fmt:formatDate value="${assitems.endDate }" pattern="yyyy-MM-dd"/></label></td>
													<td class="text-center"><label id='deductCate_lab${j.index }'><ossp:value dictType="DEFEND_SYTLE" key="${assitems.validType }"></ossp:value></label></td>
													<td class="text-center"><label id='countBase_lab${j.index }'><ossp:value dictType="COMPUTE_BASE" key="${assitems.countBase}"></ossp:value></label></td>
													<td class="text-center"><label id='taxRate_lab${j.index }'>${assitems.taxRateName}</label></td>
													<td class="text-center"><a href="javascript:void(0)" onclick="showModalAssitems(this.parentElement.parentElement.rowIndex, ${j.index })"><c:if test="${negType == 40 }">查看</c:if><c:if test="${negType != 40 }">修改</c:if></a>&nbsp;&nbsp;<a href='javascript:void(0)' class='delete' onclick='removeAssitemsRow(this, this.parentElement.parentElement.rowIndex)'>删除</a></td>
													<td class="text-center" style="display: none;">
													<input type="hidden" id='deductCode${j.index }' name="negAssitems[${j.index }].deductCode" value="${assitems.deductCode }"></input> 
												    <input type="hidden" id='assItemsStartDate${j.index }' name="negAssitems[${j.index }].startDate" value="<fmt:formatDate value="${assitems.startDate }" type="both" pattern="yyyy-MM-dd" />"></input>
												    <input type="hidden" id='assItemsEndDate${j.index }' name="negAssitems[${j.index }].endDate" value="<fmt:formatDate value="${assitems.endDate }" type="both" pattern="yyyy-MM-dd" />"></input>
												    <input type="hidden" id='assItemsValidType${j.index }' name="negAssitems[${j.index }].validType" value="${assitems.validType }"></input>
												    <input type="hidden" id='assItemsCountBase${j.index }' name="negAssitems[${j.index }].countBase" value="${assitems.countBase }"></input>
												    <input type="hidden" id='assItemsDeductType${j.index }' name="negAssitems[${j.index }].deductType" value="${assitems.deductType }"></input>
												    <input type="hidden" id='assItemsTaxRate${j.index }' name="negAssitems[${j.index }].taxRate" value="${assitems.taxRate }"></input>
												     <input type='hidden' id='deductItem${j.index }' name='negAssitems[${j.index }].deductItem' value="${assitems.deductItem }"></input>
												     <input type='hidden' id='deductCate${j.index }' name='negAssitems[${j.index }].deductCate' value="${assitems.deductCate }"></input>
												     <input type='hidden' id='amount${j.index }' name='negAssitems[${j.index }].amount' value="${assitems.amount }"></input>
<%-- 												     <input type='hidden' id='taxRateCode_items${j.index }' name='negAssitems[${j.index }].taxRate' value="${assitems.taxRate }"></input> --%>
												    <input type="hidden" id='assItemsRemarks${j.index }' name="negAssitems[${j.index }].remarks" value="${assitems.remarks }"></input>
													</td>
												</tr>
											</c:forEach>
									</table>
								</div>
								
								
								<!-- ================================================= -->
								<div class="f_2">
									<h4>
										合同条件--特殊条款信息 <input
											onclick="add_hidden('#hidden_contact','negAssTempItemCodeList')"
											type="button" name="addBtn" class="btn btn-success btn-sm pull-right"
											value="添加"></input>
									</h4>
									<table class="table table-striped table-hover o-l-table"
										id="codeTable">
										<thead>
											<tr>
												<th>特殊条款<span style="color: red;" style="width: 100px">*</span></th>
												<th>条件</th>
												<th style="width: 120px">金额</th>
												<th style="width: 300px">描述</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach items="${assrecords.negAssTempItemCodeList}"
												var="itemCode" varStatus="var">
												<tr>
													<td class="o-l-tab-ckb">
														<input type="hidden" id="assTempItemCodeList${var.index}.id" name="negAssTempItemCodeList[${var.index}].id" value="${itemCode.id}"> 
														<select data_def="${itemCode.itemCode}" data_index="${var.index}" onchange="changeItem('hidden_contact',this,this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" class="f_5 required" id="assTempItemCodeList${var.index}.itemCode" name="negAssTempItemCodeList[${var.index}].itemCode">
													</select>
													</td>
													<td class="o-l-tab-ckb">
														<select spt_Num="${itemCode.items.dicType}" data_def="${itemCode.itemCode}" data_index="${var.index}" class="f_5 required" id="assTempItemCodeList${var.index}.conditions" name="negAssTempItemCodeList[${var.index}].itemValue"></select>
													</td>
													<td class="o-l-tab-ckb">
														<input class="f_5" value="${itemCode.amount}" type="text" id="assTempItemCodeList${var.index}.amount" name="negAssTempItemCodeList[${var.index}].amount" class="f_5"></td>
													<td class="o-l-tab-ckb">
														<input type="text" value="${itemCode.remark}" id="assTempItemCodeList${var.index}.remark" name="negAssTempItemCodeList[${var.index}].remark" class="f_5 required"></td>
													<td class="o-l-tab-ckb"><input type="button"
														onclick="delete_tr(this,'#delContactId')" value="删除"
														class="btn btn-default btn-sm"></td>
												</tr>
											</c:forEach>
											<!-- 隐藏行，用于新增明细start -->
											<tr style="display: none" id="hidden_contact">
												<td class="o-l-tab-ckb">
													<select data_index="" onchange="changeItem('hidden_contact',this,this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" class="f_5 required" id=".itemCode" name=".itemCode"></select></td>
												<td class="o-l-tab-ckb">
													<select data_index="" class="f_5 required" id=".conditions" name=".itemValue"></select></td>
												<td class="o-l-tab-ckb">
													<input class="f_5" type="text" id=".amount" name=".amount"></td>
												<td class="o-l-tab-ckb">
													<input class="f_5 required" type="text" id=".remark" name=".remark"></td>
												<td>
													<input type="button" onclick="delete_tr(this,'#delContactId')" value="删除" class="btn btn-default btn-sm"></td>
											</tr>
											<!-- 隐藏行，用于新增明细end -->
										</tbody>
									</table>
								</div>

								<div class="f_3">
									<div class="form-group col-xs-12" style="display: none;">
										<label for="inputtext3" class="col-sm-2	 control-label f_4">请选择招商标准:</label>
										<div class="col-sm-6 f_6">
											<div class="input-group">
												<input type="text" class="f_5"  readonly="readonly"/> 
												<span class="input-group-btn">
													<button class="btn btn-default btn_3" id="shopDialog" type="button" disabled="disabled">选择</button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group col-xs-12">
										<label for="inputtext3" class="col-sm-3 control-label">备注:</label>
										<div class="col-sm-9">
											<textarea id="signReasons" name="comments" rows="3" class="form-control f_11">${assrecords.comments}</textarea>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="o-l-action">
					<button class="btn btn-success btn_5 btn_right" type="button" onclick="javascript:history.go(-1)">返&nbsp回</button>
<%-- 					<c:if test="${assinfo.status == 1 || assinfo.status == 3 || assinfo.status==null }">	<!-- （说明：如果状态等于1，说明是供应商提交的洽谈。 则当前页面为采购人操作） --> --%>
<!-- 						<button id="save" class="btn btn-success btn_5 btn_right" type="button" >提交至供应商</button> -->
<%-- 					</c:if> --%>
<%-- 					<c:if test="${assinfo.status == 2 }">		<!-- （说明：如果状态等于2，说明是采购人提交的洽谈。 则当前页面为供应商操作） --> --%>
<!-- 						<button id="save" class="btn btn-success btn_5 btn_right" type="button">提交至采购人</button> -->
<%-- 					</c:if> --%>
					<button id="save" class="btn btn-success btn_5 btn_right" type="button">提交</button> 
				</div>
			</form:form>
			<div class="modal fade" id="modalAssbaseitems" style="width: 800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first"></div>
			<div class="modal fade" id="modalAssitems" style="width: 800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first"></div>
			<div class="modal fade" id="modalBrand" style="width: 800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first"></div>
			<div class="modal fade" id="supplierModal" style="width: 800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first"></div>
		</div>
	</div>

	<script type="text/javascript">
	var start=0;
	var end=0;
	$('.startDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })

	$('.endDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })

	$('.terminateDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
	
	$('.effectDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
	

</script>
</body>
</html>